﻿namespace HelenServer.FileStorage.Contracts;

public interface IDalFileStorageService
{
    ValueTask<OperationResult<DownloadModel>> DownloadFileAsync(Operation<int> operation);

    ValueTask<OperationResult<FastDFSFileInfoModel>> GetFileInfo(Operation<int> operation);

    ValueTask<OperationResult<StorageNodeModel>> GetStorageNodeAsync(Operation<FileGroupModel> operation);

    ValueTask<OperationResult<string>> GetTokenAsync(Operation<int> operation, DateTime? dateTime = null);

    ValueTask<IReadOnlyCollection<GroupInfoModel>> ListAllGroupInfosAsync(Operation<string> operation);

    ValueTask<OperationResult<GroupInfoModel>> ListOneGroupInfoAsync(Operation<FileGroupModel> operation);

    ValueTask<IReadOnlyCollection<StorageInfoModel>> ListStorageInfosAsync(Operation<FileGroupModel> operation);

    ValueTask<OperationResult<StorageNodeModel>> QueryStorageNodeForFileAsync(Operation<int> operation);

    ValueTask<IReadOnlyCollection<StorageNodeModel>> QueryStorageNodesForFileAsync(Operation<int> operation);

    ValueTask<OperationResult<bool>> RemoveFileAsync(Operation<int> operation);

    ValueTask<OperationResult<int>> UploadFileAsync(Operation<UploadModel> operation, CancellationToken cancellationToken = default);

    ValueTask<OperationResult<IReadOnlyCollection<int>>> UploadFileRangeAsync(Operation<IEnumerable<UploadModel>> operation, CancellationToken cancellationToken = default);

    ValueTask<OperationResult<IReadOnlyDictionary<int, int[]>>> UploadFileRangeForMigrateAsync(Operation<IEnumerable<KeyValuePair<int, IEnumerable<UploadModel>>>> operation, CancellationToken cancellationToken = default);
}